package cpu;

public class Stall {
	boolean ifidStay;
	boolean idexeStall;
	boolean PCstay;
	public Stall(){
		ifidStay = false;
		idexeStall = false;
		PCstay = false;
	}
	public void setInput(boolean idexeIsMemRead, int idexerd, int rs, int rt,int exememrd, boolean isBranch){
		if((idexeIsMemRead && idexerd != 0 && (idexerd == rs || idexerd == rt))
				||(isBranch && exememrd != 0 && (exememrd == rs || exememrd == rt))){
			ifidStay = true;
			idexeStall = true;
			PCstay = true;
		}
		else{
			ifidStay = false;
			idexeStall = false;
			PCstay = false;
		}
	}
	public boolean getPCstay(){
		return PCstay;
	}
	public boolean getifidStay(){
		return ifidStay;
	}
	public boolean getidexeStall(){
		return idexeStall;
	}
	

}
